#include<bits/stdc++.h>
using namespace std;

double a[100005], b[100005], x[100005], dp[100005][2];
int n;

int main()
{
	cin >> n;
	for(int i=1; i<=n; i++)
	{
		cin >> x[i];
	}
	for(int i=1; i<n; i++)
	{
		cin >> a[i] >> b[i+1];
	}
	
	dp[1][0] = x[1]/1.0;
	dp[1][1] = x[1]/1.0 + a[1]/0.7;
	for(int i=2; i<=n; i++)
	{
		if(a[i] > b[i])
		{
			dp[i][1] = min(dp[i-1][1]+(a[i]-b[i])/0.7, 
			dp[i-1][0] + (x[i]-x[i-1])/1.0 + a[i]/0.7); 
		}
		else
		{
			dp[i][1] = min(dp[i-1][1] + (b[i]-a[i])/1.3,
			dp[i-1][0] + (x[i]-x[i-1])/1.0 + a[i]/0.7);
		}
		dp[i][0] = min(dp[i-1][0] + (x[i]-x[i-1])/1.0, 
		dp[i-1][1] + b[i]/1.3);
	}
	printf("%.2lf\n", dp[n][0]);
	
	return 0;
}